﻿<UserControl x:Class="iRobotController.RoombaStatus"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:iRobotController" xmlns:converter="clr-namespace:WPFExtensions.Converters;assembly=WPFExtensions" mc:Ignorable="d" DataContext="{Binding}">
    <Grid>
        <Grid.Resources>
            <local:BkgdColour x:Key="BkgdColour" />
            <local:WarningBkgdColour x:Key="WarningBkgdColour"/>
            <converter:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
        </Grid.Resources>
        <Label Content="Charge %" HorizontalAlignment="Left"  VerticalAlignment="Top" FontWeight="Bold" />
        <Label Content="{Binding Path=ChargeStatePercentage}" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="40" Margin="0,15,0,0"/>
        <Label Content="Charge State"  HorizontalAlignment="Left"  VerticalAlignment="Top" Margin="0,30,0,0" FontWeight="Bold" />
        <Label Content="{Binding Path=ChargeState}" HorizontalAlignment="Left"  VerticalAlignment="Top" Margin="0,45,0,0" Width="80"/>
        <Label Content="Heartbeat" Visibility="{Binding Path=HeartBeatFire, Converter={StaticResource BoolToVisibilityConverter}}" Margin="0,60,0,0" Foreground="Red" FontWeight="Bold" />
        <Slider Margin="0,75,0,0" Width="70" HorizontalAlignment="Left"  VerticalAlignment="Top" Minimum="100" Maximum="1000" Value="{Binding Path=HeartBeatCheckTime}" TickPlacement="Both" TickFrequency="100" />
        <Image Width="Auto" Height="Auto" Source="/iRobotController.Y2009.M08;component/Images/roomba560.jpg" ClipToBounds="True" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="1" />
        <Label Background="{Binding Path=LeftBumperHit, Converter={StaticResource BkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Left Bumper" Height="30" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Margin="89,75,0,0" VerticalAlignment="Top" Width="110"  Panel.ZIndex="1"/>
        <Label Background="{Binding Path=LeftCliffDetected, Converter={StaticResource BkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Left Cliff" Height="30" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Margin="89,12,0,0" VerticalAlignment="Top" Width="110" Panel.ZIndex="1"/>
        <ToggleButton IsChecked="{Binding Path=IgnoreLeftWheelDrop}" Foreground="{Binding Path=LeftWheelDrop, Converter={StaticResource BkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Left Wheeldrop" Height="30" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalAlignment="Top" Width="110" Panel.ZIndex="1" Margin="12,218,0,0" FontWeight="Normal" />
        <Label Background="{Binding Path=RightCliffDetected, Converter={StaticResource BkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Right Cliff" Height="30" HorizontalAlignment="Right" HorizontalContentAlignment="Center" Margin="0,12,89,0"  VerticalAlignment="Top" Width="110" Panel.ZIndex="1"/>
        <Label Background="{Binding Path=RightBumperHit, Converter={StaticResource BkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Right Bumper" Height="30" HorizontalAlignment="Right" HorizontalContentAlignment="Center" Margin="0,75,88,0"  VerticalAlignment="Top" Width="110" Panel.ZIndex="1"/>
        <ToggleButton IsChecked="{Binding Path=IgnoreRightWheelDrop}" Foreground="{Binding Path=RightWheelDrop, Converter={StaticResource BkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Right Wheeldrop" Height="30" HorizontalAlignment="Right" HorizontalContentAlignment="Center" VerticalAlignment="Top" Width="110" Panel.ZIndex="1" Margin="0,218,12,0" IsTabStop="False" FontWeight="Normal" />
        <Label Background="{Binding Path=LeftWheelOvercurrent, Converter={StaticResource WarningBkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Left Wheel OverCurrent" Height="30" HorizontalAlignment="Left" HorizontalContentAlignment="Center" VerticalAlignment="Top" Width="150" Panel.ZIndex="1" Margin="12,182,0,0" />
        <Label Background="{Binding Path=RightWheelOvercurrent, Converter={StaticResource WarningBkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Right Wheel OverCurrent" Height="30" HorizontalAlignment="Right" HorizontalContentAlignment="Center" VerticalAlignment="Top" Width="150" Panel.ZIndex="1" Margin="0,182,12,0" />
        <Label Background="{Binding Path=SideBrushOvercurrent, Converter={StaticResource WarningBkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Side Brush Over Current" Height="30" HorizontalAlignment="Right" HorizontalContentAlignment="Center" Margin="0,134,12,0"  VerticalAlignment="Top" Width="150" Panel.ZIndex="1"/>
        <Label Background="{Binding Path=VacuumOvercurrent, Converter={StaticResource WarningBkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Vacuum Over Current" Height="30" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Bottom" Width="150" Panel.ZIndex="1" VerticalContentAlignment="Top" Margin="0" />
        <ToggleButton IsChecked="{Binding Path=IgnoreMainBrushOverCurrent}" Foreground="{Binding Path=MainBrushOvercurrent, Converter={StaticResource WarningBkgdColour}}" BorderBrush="Black" BorderThickness="1" Content="Main Brush OverCurrent" Height="30" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" Width="150" Panel.ZIndex="1" Margin="0" IsTabStop="False" FontWeight="Normal" />
    </Grid>
</UserControl>
